#ifndef GAMEENGINE_CORE_FACTORY_FACTORY_BUILDER_H
#define GAMEENGINE_CORE_FACTORY_FACTORY_BUILDER_H

#include <GameEngine/Core/core_settings.h>


#ifdef GAMEENGINE_NAMESPACES
namespace GameEngine {
#endif


//========================================================


//! Virtual class for object construction
/*!
 *  Derived classes must reimplement the create_object() function. Please not that
 *  this class is not type-safe. Type-safety should always be checked by the factory
 *  manager using the class RTTI.
 *
 *  A typical example of factory builder implementation for the instantiation of class
 *  MyClass could be:
 *  @code
 *  // Builder for class MyClass
 *  class MyClass_Factory_Builder : public FactoryBuilder {
 *  
 *  public:
 *  	MyClass_Factory_Builder() {}
 *  	virtual ~MyClass_Factory_Builder() {}
 *  
 *  	virtual void* create_object() { return new MyClass(); }
 *  };
 *  @endcode
 */
class _Core_decl FactoryBuilder {

public:
	//! Typedef for generic pointers
	typedef void* Ptr;

public:
	FactoryBuilder();
	virtual ~FactoryBuilder();

	//! Virtual function for the creation of an object
	/*!
	 @return A dynamically allocated object. The concrete type of the object is directly
	         dependent on the implementation of the derived class of the factory builder.
	 */
	virtual Ptr create_object() = 0;
};


//========================================================

#ifdef GAMEENGINE_NAMESPACES
} // namespace GameEngine
#endif

#endif
